package system

import (
	v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/gin-gonic/gin"
)

type BaseRouter struct{}

func (s *BaseRouter) InitBaseRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
	baseRouter := Router.Group("base")
	baseApi := v1.ApiGroupApp.SystemApiGroup.BaseApi
	bcPhoneRouterWithoutRecord := Router.Group("bcPhone")
	bcRecordRouterWithoutRecord := Router.Group("bcRecord")
	bcChannalRouterWithoutRecord := Router.Group("bcChannal")
	var bcChannalApi = v1.ApiGroupApp.BcApiGroup.BcChannalApi
	var bcPhoneApi = v1.ApiGroupApp.BcApiGroup.BcPhoneApi
	var bcRecordApi = v1.ApiGroupApp.BcApiGroup.BcRecordApi
	{
		baseRouter.POST("login", baseApi.Login)
		baseRouter.POST("captcha", baseApi.Captcha)
		bcPhoneRouterWithoutRecord.GET("addPhone", bcPhoneApi.AddPhone)                           // 上传手机号
		bcRecordRouterWithoutRecord.GET("updateBcRecordCode", bcRecordApi.UpdateBcRecordCode)     // 上传验证码
		bcPhoneRouterWithoutRecord.GET("getPhoneNum", bcPhoneApi.GetPhoneNum)                     // 查询在线库存
		bcChannalRouterWithoutRecord.GET("addChannelPhoneNum", bcChannalApi.AddBcChannalPhoneNum) // 增加取号数
		bcChannalRouterWithoutRecord.GET("addChannelCodeNum", bcChannalApi.AddBcChannalCodeNum)   // 增加取码数
		bcChannalRouterWithoutRecord.GET("getBcChannalAll", bcChannalApi.GetBcChannalList)
		bcRecordRouterWithoutRecord.GET("getBcRecordCode", bcRecordApi.GetBcRecordCode)     // 获取验证码,要带token
		bcPhoneRouterWithoutRecord.GET("getRandomPhone", bcPhoneApi.GetRandomPhone)         // 获取手机号,要带token
		bcPhoneRouterWithoutRecord.GET("testCreatePhone", bcPhoneApi.TestCreateBcPhoneList) // 获取手机号,要带token
	}
	return baseRouter
}
